package com.example.a2105_ivideo.push;

import android.content.Context;

import com.example.lib_common.utils.LoggerUtils;
import com.tencent.android.tpush.XGPushBaseReceiver;
import com.tencent.android.tpush.XGPushClickedResult;
import com.tencent.android.tpush.XGPushRegisterResult;
import com.tencent.android.tpush.XGPushShowedResult;
import com.tencent.android.tpush.XGPushTextMessage;

/**
 * @author yaotianxue
 * @description
 * @date 2025/3/11
 */
public class IVideoMessageReceiver extends XGPushBaseReceiver {
    @Override
    public void onRegisterResult(Context context, int i, XGPushRegisterResult xgPushRegisterResult) {
        //注册结果
        LoggerUtils.INSTANCE.d("推送","注册"+xgPushRegisterResult.toString());
    }

    @Override
    public void onUnregisterResult(Context context, int i) {
        //解除注册
        LoggerUtils.INSTANCE.d("推送","解除注册");

    }

    @Override
    public void onSetTagResult(Context context, int i, String s) {

    }

    @Override
    public void onDeleteTagResult(Context context, int i, String s) {

    }

    @Override
    public void onSetAccountResult(Context context, int i, String s) {

    }

    @Override
    public void onDeleteAccountResult(Context context, int i, String s) {

    }

    @Override
    public void onSetAttributeResult(Context context, int i, String s) {

    }

    @Override
    public void onQueryTagsResult(Context context, int i, String s, String s1) {

    }

    @Override
    public void onDeleteAttributeResult(Context context, int i, String s) {

    }

    @Override
    public void onTextMessage(Context context, XGPushTextMessage xgPushTextMessage) {
        //接受透传消息
        String customContent = xgPushTextMessage.getCustomContent();
        String title = xgPushTextMessage.getTitle();
        String content = xgPushTextMessage.getContent();
        LoggerUtils.INSTANCE.d("推送","透传消息"+customContent);
        LoggerUtils.INSTANCE.d("推送","透传消息"+content);
        LoggerUtils.INSTANCE.d("推送","透传消息"+title);

    }

    @Override
    public void onNotificationClickedResult(Context context, XGPushClickedResult xgPushClickedResult) {
        LoggerUtils.INSTANCE.d("推送","通知点击"+xgPushClickedResult.toString());
    }

    @Override
    public void onNotificationShowedResult(Context context, XGPushShowedResult xgPushShowedResult) {
        LoggerUtils.INSTANCE.d("推送","通知展示"+xgPushShowedResult.toString());
    }
}
